package com.wd.mylibrary_my.viewmodel

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.wd.mylibrary_base.bean.MyMessageBean
import com.wd.mylibrary_base.utils.HttpUtils
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers

/**
 * 作者： 袁春杰
 * 日期： 2024/9/15 11:14
 * 功能：
 */

class MyViewModel:ViewModel() {
    var myMessageData=MutableLiveData<MyMessageBean>()

    fun getMyMessageData(userId:Int,sessionId:String){
        HttpUtils.httpUtils.apiService.getMyMessage(userId, sessionId)
            .subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe {
                myMessageData.value=it
            }
    }
}